home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / refex / ex51.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  359 b   |  24 lines

  1. Program Example51;
  2.  
  3. { Program to demonstrate the Reset function. }
  4.  
  5. Function FileExists (Name : String) : boolean;
  6.  
  7. Var F : File;
  8.  
  9. begin
  10.   {$i-}
  11.   Assign (F,Name);
  12.   Reset (F);
  13.   {$I+}
  14.   FileExists:=(IoResult=0) and (Name<>'');
  15.   Close (f);
  16. end;
  17.  
  18. begin
  19.   If FileExists (Paramstr(1)) then
  20.     Writeln ('File found')
  21.   else
  22.     Writeln ('File NOT found');
  23. end.
  24.